<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
	<meta charset="utf-8">
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
	<META HTTP-EQUIV="Expires" CONTENT="0"> 
	<title>首页</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../css/main.css" media="all" />
	<link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
	<script type="text/javascript" src="../../layui/layui/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="../../layui/layui/GetPath.js"></script>
	<script src="../../layui/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../layui/js/fy.js"></script>
	<script type="text/javascript" src="../../layui/layui/layer.ext.js"></script>
	<script type="text/javascript" src="../../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../../layui/js/jegs.js"></script>
	<script type="text/javascript" src="../layui/js/jegs.js"></script>
<script type="text/javascript" src="../js/angular.js"></script>
</head>
<body class="childrenBody">
	<div class="layui-form links_list" ng-app="myApp" ng-controller="customersCtrl" align="center" >

	<div class="panel_box row">
		<div class="panel col">
			<a href="javascript:;" >
				<div class="panel_icon">
					<i class="fa fa-jpy" aria-hidden="true"></i>
				</div>
				<div class="panel_word newMessage">
					<span id="DWZHYE" style="font-family:Arial;">&yen0.00</span>
					<cite>单位公积金余额</cite>
				</div>
			</a>
		</div>
		<div class="panel col">
			<a href="javascript:;" data-url="page/user/allUsers.html">
				<div class="panel_icon" style="background-color:#FF5722;">
					<i class="fa fa-credit-card" aria-hidden="true"></i>
				</div>
				<div class="panel_word userAll">
					<span id="YJCE" style="font-family:Arial;">&yen0.00</span>
					<cite>单位缴存额</cite>
				</div>
			</a>
		</div>
		<div class="panel col">
			<a href="javascript:;" data-url="page/user/allUsers.html">
				<div class="panel_icon" style="background-color:#009688;">
					<i class="fa fa-shopping-bag" aria-hidden="true"></i>
				</div>
				<div class="panel_word userAll">
					<span id="DWJCRS">0</span>
					<cite>单位实缴人数</cite>
				</div>
			</a>
		</div>
		<div class="panel col">
			<a href="javascript:;" data-url="page/user/allUsers.html">
				<div class="panel_icon" style="background-color:#5FB878;">
					<i class="fa fa-money" aria-hidden="true"></i>
				</div>
				<div class="panel_word userAll">
					<span id="YHMC"></span>
					<cite>缴存银行</cite>
				</div>
			</a>
		</div>
	</div>
	
	<div class="row">
		<div class="sysNotice col">
			<blockquote class="layui-elem-quote title">我的公积金信息</blockquote>
			<div class="layui-elem-quote layui-quote-nm" >
				<canvas id="a_canvas" width="600" height="485"></canvas>
			</div>
		</div>
		<div class="sysNotice col">
			<blockquote class="layui-elem-quote title">公积金网点信息</blockquote>
			<table class="layui-table">
				<colgroup>
					<col width="150">
					<col>
				</colgroup>
				<tbody>
					<tr>
						<td>延吉长白路管理部</td>
						<td>延吉市天池路3399号，市法院西侧。电话0433-2268539</td>
					</tr>
					<tr>
						<td>延吉友谊路管理部</td>
						<td>延吉市友谊路661号。电话0433--2263588</td>
					</tr>
					<tr>
						<td>龙井管理部</td>
						<td>原龙井市法院对过，盛泰小区门市。电话0433-3222683</td>
					</tr>
					<tr>
						<td>敦化管理部</td>
						<td>敦化市翰章大街809号，建行总行斜对过。电话0433-6226775</td>
					</tr>
					<tr>
						<td>珲春管理部</td>
						<td>珲春市靖和街森林山大路环亚山城门市。 电话0433-7563737</td>
					</tr>
					<tr>
						<td>长白山管理部</td>
						<td>二道镇景民路丽都紫薇阁门市。电话0433-5720866 </td>
					</tr>
					<tr>
						<td>安图管理部</td>
						<td>安图县明月镇鑫田小区。电话0433-5925999</td>
					</tr>
					<tr>
						<td>图们管理部</td>
						<td>图们市恒昊大厦门市。电话0433-3630314</td>
					</tr>
					<tr>
						<td>汪清管理部</td>
						<td>汪清县益佳花园小区12号门市，益生商务酒店西。电话0433-8814370</td>
					</tr>
					<tr>
						<td>和龙管理部</td>
						<td>和龙市七中对过，兴烨首府5号楼。电话0433-4233837</td>
					</tr>
				</tbody>
			</table>
			<blockquote class="layui-elem-quote title">系统通知</blockquote>
			<div style="overflow-y :auto;height:77.8px">
		<table class="layui-table">
				<colgroup>
					<col width="150">
					<col>
				</colgroup>
				<tbody class="hot_news">
					<tr ng-repeat="x in names">
						<td align="left">{{x.TZSJ}}</td>
						<td>{{x.XTTZNR}}</td>
					</tr>
				</tbody>
			</table> 
			</div>
		</div>
	</div>
</div>
	<script type="text/javascript" src="../layui/layui.js"></script>
	<script type="text/javascript" src="../../layui/layui/GetPath.js"></script>
	<script type="text/javascript" src="../layui/layui/jquery-3.2.1.min.js"></script>
	<script type="text/javascript">
	$(function(){
			$.ajax({
				url :'/wsyyt/dwjcyecontroller/test',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
					var data = result.data;//这边的data属性是object
					if(result.code==0){
						$.each(data[0], function(key, value) {
							$("#" + key).html(value);
							console.log(data[0]);
						});
						$("#DWZHYE").html(formatCurrency(data[0].DWZHYE));
							$("#YJCE").html(formatCurrency(data[0].YJCE));
					}else{
						layer.msg('提示：'+result.CW,{icon: 5});	
					}
				},
			});
		});
	</script>
	<script>
    (function (){
        window.addEventListener("load", function(){
         var data ;
          var xinforma ;
          var rq=new Array();
          var je=new Array();
 		 $.ajax({
				url :'/wsyyt/dwhbjxxcontroller/test1',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
				result=result.data.RETDATA;
				for(var i=0;i<result.length;i++){
					rq.push(result[i].SHRQ);
					je.push(result[i].JCJE);
				}
				if(je == null || je == "" || rq=="" || rq==null){
				  data = [0];
         		  xinforma = ['最近一年内没有缴存记录'];
				}else{
					data=je;
					xinforma=rq;
				}
				 // 获取上下文
          var a_canvas = document.getElementById('a_canvas');
          var context = a_canvas.getContext("2d");
          // 绘制背景
          var gradient = context.createLinearGradient(0,0,0,100);
         // gradient.addColorStop(0,"#e0e0e0");
          //gradient.addColorStop(1,"#ffffff");
          context.fillStyle = gradient;
          context.fillRect(0,0,a_canvas.width,a_canvas.height);
          var realheight = a_canvas.height-15;
          var realwidth = a_canvas.width-40;
          // 描绘边框
          var grid_cols = data.length + 1;
          var grid_rows = 4;
          var cell_height = realheight / grid_rows;
          var cell_width = realwidth / grid_cols;
          context.lineWidth = 1;
          context.strokeStyle = "#a0a0a0";
          // 结束边框描绘
          context.beginPath();
          //划横线
          context.moveTo(0,realheight);
          context.lineTo(realwidth,realheight);
          //画竖线
          context.moveTo(0,20);
          context.lineTo(0,realheight);
          context.lineWidth = 1;
          context.strokeStyle = "black";
          context.stroke();
          var max_v =0;
          for(var i = 0; i<data.length; i++){
             if (parseFloat(data[i]) >parseFloat( max_v)) { 
           	 	max_v =data[i];
            };
          }
          max_v = max_v * 1.1;
          // 将数据换算为坐标
          var points = [];
          for( var i=0; i < data.length; i++){
            var v= data[i];
            var px = cell_width * (i +1);
            var py = realheight - realheight*(v / max_v);
            points.push({"x":px,"y":py});
          }
 
          //绘制坐标图形
          for(var i in points){
            var p = points[i];
            context.beginPath();
            context.fillStyle="green";
            context.fillRect(p.x,p.y,15,realheight-p.y);
            context.fill();
          }
          //添加文字
          for(var i in points)
          {  var p = points[i];
            context.beginPath();
            context.fillStyle="black";
            context.fillText(data[i], p.x + 1, p.y - 15);
             context.fillText(xinforma[i],p.x + 1,realheight+12);
             context.fillText('年月',realwidth,realheight+12);
             context.fillText('最近一年缴存金额',0,10);
              }
        }
 		  });
         },false);
      })();
      	function getPath() {  
	        return 'http://'+location.host;
		}
		var app = angular.module('myApp', []);
		app.controller('customersCtrl', function($scope, $http) {
		$http({
			url:getPath() + "/wsyyt/xtxxcontroller/test1",
			type:'post',
			params:{ZT:2}
		})
			.then(function(res) {
			 if(res.data.msg==null)
				 {
				 	layer.msg("登陆失效请重新登陆");
					setTimeout(function () {
						window.top.location.href=res.data;
					}, 1500);
					return;
				 }
			$scope.names=res.data.data;
			});
		});
	layui.use('layer', function(){
  var layer = layui.layer;
  
});  
</script>
</body>
</html>